home *** CD-ROM | disk | FTP | other *** search
- Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!sgiblab!idiom.berkeley.ca.us!apollo.west.oic.com!apollo.west.oic.com!not-for-mail
- From: dillon@apollo.west.oic.com (Matthew Dillon)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Task Priority Question
- Date: 4 May 1994 21:40:23 -0700
- Organization: Obvious Implementations Corp
- Lines: 38
- Distribution: world
- Message-ID: <2q9tbn$hn4@apollo.west.oic.com>
- References: <Cp8H3x.86A@festival.ed.ac.uk> <1994May4.140305.25547@ousrvr.oulu.fi>
- NNTP-Posting-Host: apollo.west.oic.com
-
- In article <1994May4.140305.25547@ousrvr.oulu.fi> kilroy@tolsun.oulu.fi (Lauri Aalto) writes:
- :In article <Cp8H3x.86A@festival.ed.ac.uk> andrewb@castle.ed.ac.uk (Andrew Begg) writes:
- :>What functions allow me to change the priority of my C programs so that
- :>the CPU gives more (or, perhaps, all) of its time to my code?
- :
- :oldpri = SetTaskPri(FindTask(0L),newpri);
- :/* do your stuff here */
- :SetTaskPri(FindTask(0L),oldpri); /* reset priority */
- :
- :
- :
- :
- : (__) Lauri Aalto
- : w \@@/ kilroy@tolsun.oulu.fi
- : `/v/-e 2:228/406.2@fidonet
- : _/ \_ ...Intel inside--idiot outside...
-
- Be careful... the Amiga only round-robins processes running at the
- same priority, if you set your priority higher your process can
- take ALL the available cpu, locking out everything else. Most
- processes run at priority 0, setting yours to priority 1 is usually
- sufficient if you need extra CPU, but even that will lock out (while
- you are not blocked waiting for something) all other user processes.
- It doesn't block out the filesystem code or input.device... you have
- to up your priority to 20 or more to do that, but it blocks out enough
- to make the machine unusable if your process gets into an infinite
- loop at that priority.
-
- -Matt
-
- --
-
- Matthew Dillon dillon@apollo.west.oic.com
- 1005 Apollo Way
- Incline Village, NV. 89451 ham: KC6LVW (no mail drop)
- USA Sandel-Avery Engineering (702)831-8000
- [always include a portion of the original email in any response!]
-